﻿// ReSharper disable InconsistentNaming

using System;
using System.Collections.Generic;
using ImageProcessing.Detectors;
using ImageProcessing.PointsSampler;
using NUnit.Framework;

namespace ImageProcessing.Tests.Engine
{
#if DEVMACINE
    [TestFixture]
#else
    [TestFixture, Ignore]
#endif
    public class ImageProcessingEngineTests : ImageProcessingEngineTestBase
    {
        private readonly List<string> listTemplates = new List<string>()
                                                          {
                                                              "TestPics\\Card1Template.jpg", 
                                                              "TestPics\\Card2Template.jpg",
                                                              "TestPics\\Microwave1Template.jpg",
                                                              "TestPics\\Weetbix1Template.jpg",
                                                              "TestPics\\usb1.jpg",
                                                          };

        private readonly List<List<string>> listCompares = new List<List<string>>()
        { 
            new List<string>() { "TestPics\\Card1ZoomedIn.jpg", "TestPics\\Card1ZoomedOut.jpg", "TestPics\\Card1Skewed.jpg","TestPics\\Card1Rotate90.jpg","TestPics\\Card1Rotate180.jpg" },
            new List<string>() { "TestPics\\Card2ZoomedIn.jpg", "TestPics\\Card2ZoomedOut.jpg", "TestPics\\Card2Skewed.jpg","TestPics\\Card2Rotate90.jpg","TestPics\\Card2Rotate180.jpg" },
            new List<string>() { "TestPics\\Microwave1ZoomedIn.jpg", "TestPics\\Microwave1ZoomedOut.jpg", "TestPics\\Microwave1Skewed.jpg","TestPics\\Microwave1Rotate90.jpg","TestPics\\Microwave1Rotate180.jpg" },
            new List<string>() { "TestPics\\Weetbix1ZoomedIn.jpg", "TestPics\\Weetbix1ZoomedOut.jpg", "TestPics\\Weetbix1Skewed.jpg","TestPics\\Weetbix1Rotate90.jpg","TestPics\\Weetbix1Rotate180.jpg" },
            new List<string>() { "TestPics\\usb2.jpg", "TestPics\\usb3.jpg", "TestPics\\usb4.jpg","TestPics\\usb5.jpg","TestPics\\usb6.jpg","TestPics\\usb7.jpg","TestPics\\usb8.jpg","TestPics\\usb9.jpg","TestPics\\usb10.jpg","TestPics\\usb11.jpg" },
        };


        public IEnumerable<TestCaseData> TestCasesInput
        {
            get
            {
                foreach (var cameraModes in Enum.GetValues(typeof(CameraMode)))
                {
                    foreach (var detectorType in Enum.GetValues(typeof(DetectorType)))
                    {
                        foreach (var sampleType in Enum.GetValues(typeof(InterestPointsSamplerFactory.SampleType)))
                        {
                            for (int i = 0; i < listTemplates.Count; i++)
                            {
                                TestCaseData.Add(new TestCaseData(cameraModes, detectorType, sampleType, listTemplates[i], listCompares[i]));
                            }
                        }
                    }
                }

                return TestCaseData;
            }
        }

        [TestCaseSource("TestCasesInput")]
        public void Start_PointsDetector_Equal(CameraMode cameraMode, DetectorType detectorType, InterestPointsSamplerFactory.SampleType sampleType, string learnFileName, List<string> compareFileNames)
        {
            BaseTester(cameraMode, detectorType, sampleType, learnFileName, compareFileNames);
        }
    }
}
